#ifndef _FILES_H_CSEAPI_
#define _FILES_H_CSEAPI_

class TCharArray;  // forward declare

extern TCharArray GetCurrExeFileName();
extern TCharArray ChangeFileExt(const TCharArray& sFile, const TCharArray& ext);
extern TCharArray ExtractFileExt(const TCharArray& FileName);
extern TCharArray ExtractFileName(const TCharArray& FileName);
extern TCharArray ExtractFileDir(const TCharArray& FileName);
extern TBool FileExists(const TXchar *FileName);
extern TBool DirExists(const TXchar *DirName);
extern TCharArray NormalizeFileName(const TCharArray& sFile);
extern TBool SearchSubDirs(TCharArray& sOut, const TCharArray& dir);

class TDllFile
{
private:
    void *m_handle;

public:
    TDllFile(const TXchar *file);
    ~TDllFile();

    static void *loadLib(const TXchar *file);
    static void unloadLib(void *handle);

    TBool isLoaded();
    void attach(void * handle);
    void *detach();
    void *getSymbol(const TXchar *name);
};

extern TCharArray Cse_GetHomeDir();

#endif
